#include "../CApp.h"

void CApp::OnCleanup() {
    SDL_FreeSurface(Surf_Background1);
    SDL_FreeSurface(Surf_Background2);
    SDL_FreeSurface(Surf_Background3);
    
	SDL_FreeSurface(HUD_Fond);
    SDL_FreeSurface(HUD_Life);
    SDL_FreeSurface(HUD_Coin);
	SDL_FreeSurface(HUD_Timer);
    
    CMap::MapControl.OnCleanup();
    SDL_FreeSurface(Surf_Display);
    Mix_CloseAudio();
    TTF_Quit();
    SDL_Quit();
    for(int i = 0;i < CEntity::EntityList.size();i++) {
        if( !CEntity::EntityList[i] ) continue;
        
        CEntity::EntityList[i]->OnCleanup();
    }
    
    CEntity::EntityList.clear();
}
